package com.ruoyi.system.service;

import com.ruoyi.common.core.domain.entity.SysArea;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;
import java.util.Map;

/**
 * 地区Service接口
 *
 * @author shuyan
 * @date 2020-11-05
 */
public interface ISysAreaService {

    List<SysArea> listByParent(Boolean useLocale, String parentCode);

    SysArea getByCode(Boolean useLocale, String code);

    @Cacheable(key = "T(String).valueOf('code:').concat(#useLocale).concat('_').concat(#code)")
    SysArea getById(Boolean useLocale, Long id);

    List<SysArea> listByParentUser(Boolean useLocale, String parentCode);


    int importAreas(List<Map<String, String>> mapList, Boolean useLocale, boolean cleanImport);

    int syncFromStandard();

    int saveAreaWithCodes(SysArea area);

    int removeAreas(Boolean useLocale, String code);

    int dropArea(List<SysArea> areas);

    Map<Integer, SysArea> getEachLevelByCode(boolean useLocale, String code);

    List<SysArea> listByRootCodeAndLevel(boolean useLocale, String rootCode, Integer level);

    void cleanCaches();
}
